version 12.1

******** Do-file producing histograms for the figures

* Note: In order to produce exactly the same histograms, please run each section ending with "exit" separately and insert manually the small changes rescaling the x-axis
* You can also run the entire script (after deleting "exit"). In this case, the x-axes of the histograms will be scaled slightly differently.

** Histogram "Interest in Politics"
use data.dta, clear
hist pol_interest if nonmissing==1, discrete fcolor(gs15) lcolor(black) graphregion(fcolor(white)) ///
xsca(noline r(0.5/4)) xlabel(1 "none" 2 "some" 3 "fair" 4 "high", labsize(3)) xtitle("Interest in politics", size(3)) ///
ysca(noline) ylabel(,labsize(3)) ytitle("Density", size(3)) saving(hist_polinterest, replace)
* You need to set the lower bound of the x-axis to 0.5 for this histogram to be identical to the one published
* Start the Graph Editor
* From the Graph menu choose the X Axis Properties
* Choose Scale from the Global properties
* Tick the Extend range of axis scale
* Set the lower limit to 0.5
* Apply and save the graph
exit

** Histogram "Left-Right"
use data.dta, clear
hist left_right if nonmissing==1, discrete fcolor(gs15) lcolor(black) graphregion(fcolor(white)) ///
xsca(noline r(0.5/10.5) noextend) xlabel(1 "left" 5 "center" 10 "right", labsize(3)) xtitle("Ideology", size(3)) ///
ysca(noline) ylabel(,labsize(3)) ytitle("Density", size(3)) saving(hist_leftright, replace)
* You need to set the lower bound of the x-axis to 0.5 for this histogram to be identical to the one published
* Start the Graph Editor
* From the Graph menu choose the X Axis Properties
* Choose Scale from the Global properties
* Tick the Extend range of axis scale
* Set the lower limit to 0.5
* Apply and save the graph
exit

** Histogram "Saliency of Education"
use data.dta, clear
hist edu_imp if nonmissing==1, discrete fcolor(gs15) lcolor(black) graphregion(fcolor(white)) ///
xsca(noline r(0.5/4.5)) xlabel(1 " " 2 " " 3 " " 4 " ", labsize(3)) xtitle("Saliency education", size(3)) ///
ysca(noline) ylabel(,labsize(3)) ytitle("Density", size(3)) saving(hist_eduimp, replace)
* You need to set the lower bound of the x-axis to 0.5 for this histogram to be identical to the one published
* Start the Graph Editor
* From the Graph menu choose the X Axis Properties
* Choose Scale from the Global properties
* Tick the Extend range of axis scale
* Set the lower limit to 0.5
* Apply and save the graph
exit

** Histogram "Saliency of Income"
use data.dta, clear
hist inc_imp if nonmissing==1, discrete fcolor(gs15) lcolor(black) graphregion(fcolor(white)) ///
xsca(noline r(0.5/4.5)) xlabel(1 " " 2 " " 3 " " 4 " ", labsize(3)) xtitle("Saliency income", size(3)) ///
ysca(noline) ylabel(,labsize(3)) ytitle("", size(3)) saving(hist_incimp, replace)
* You need to set the lower bound of the x-axis to 0.5 for this histogram to be identical to the one published
* Start the Graph Editor
* From the Graph menu choose the X Axis Properties
* Choose Scale from the Global properties
* Tick the Extend range of axis scale
* Set the lower limit to 0.5
* Apply and save the graph
exit

** Histogram "Saliency of Integrity"
use data.dta, clear
hist hon_imp if nonmissing==1, discrete fcolor(gs15) lcolor(black) graphregion(fcolor(white)) ///
xsca(noline r(0.5/4.5)) xlabel(1 " " 2 " " 3 " " 4 " ", labsize(3)) xtitle("Saliency integrity", size(3)) ///
ysca(noline) ylabel(,labsize(3)) ytitle("", size(3)) saving(hist_honimp, replace)
exit

** Histogram "Saliency of Tax-spend"
use data.dta, clear
hist taxspend_imp if nonmissing==1, discrete fcolor(gs15) lcolor(black) graphregion(fcolor(white)) ///
xsca(noline r(0.5/4.5)) xlabel(1 " " 2 " " 3 " " 4 " ", labsize(3)) xtitle("Saliency tax-spend", size(3)) ///
ysca(noline) ylabel(,labsize(3)) ytitle("Density", size(3)) saving(hist_taxspend, replace)
exit

** Histogram "Saliency of Same-sex rights"
use data.dta, clear
hist samesex_imp if nonmissing==1, discrete fcolor(gs15) lcolor(black) graphregion(fcolor(white)) ///
xsca(noline r(0.5/4.5)) xlabel(1 " " 2 " " 3 " " 4 " ", labsize(3)) xtitle("Saliency same-sex rights", size(3)) ///
ysca(noline) ylabel(,labsize(3)) ytitle("", size(3)) saving(hist_samesex, replace)
* You need to set the lower bound of the x-axis to 0.5 for this histogram to be identical to the one published
* Start the Graph Editor
* From the Graph menu choose the X Axis Properties
* Choose Scale from the Global properties
* Tick the Extend range of axis scale
* Set the lower limit to 0.5
* Apply and save the graph
exit

** Combining histograms on salience distribution
graph combine hist_eduimp.gph hist_incimp.gph hist_honimp.gph hist_taxspend.gph hist_samesex.gph, graphregion(fcolor(white)) ycommon xcommon ///
saving(hist_allimp, replace)
exit

** Histogram "Age"
use data.dta, clear
hist age if nonmissing==1, discrete fcolor(gs15) lcolor(black) graphregion(fcolor(white)) ///
xsca(noline r(19/50)) xlabel(20 30 40 50, labsize(3)) xtitle("Age", size(3)) ///
ysca(noline) ylabel(,labsize(3)) ytitle("Density", size(3)) saving(hist_age, replace)
exit


